#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>
//strcpy的基本实现
char* my_strcpy(char* dest,const char* src)
{
	assert(src != NULL||dest!=NULL);//断言
	char* ret = dest;
	while (*src!='\0')
	{
		*dest = *src;
		dest++;
		src++;
	}
	*dest = *src;
	/*改进
	while (*dest++=*src++)
	{
		;
	}*/
	return ret;
}
int main()
{
	char arr1[20] = "xxxxxxxxxxx";
	char arr2[] = "666";
	//printf("%s\n", arr1);
	printf("%s\n", my_strcpy(arr1, arr2));//链式访问
}
//strlen的基本实现
size_t my_strlen(const char* arr)
{
	int count = 0;
	assert(arr);
	while (*arr!='\0')
	{
		count++;
		arr++;
	}
	return count;
}
int main()
{
	char arr[] = "abcf";
	printf("%d", my_strlen(arr));
}